import socket
import struct
def main():
    tcp_client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    tcp_client.connect(('127.0.0.1',8000))
    msg_len=tcp_client.recv(4)
    msg_lenth=struct.unpack('i',msg_len)[0]
    print(msg_lenth)
    msg=tcp_client.recv(msg_lenth).decode('utf-8')
    print('msg:',msg)
    msg2=tcp_client.recv(1024).decode('utf-8')
    print('msg2:',msg2)
    tcp_client.close()

if __name__ == '__main__':
    main()